package cn.jingzhuan.fm.di.component

import cn.jingzhuan.fm.mvp.contract.FMAudioCommentContract
import cn.jingzhuan.fm.ui.activity.FMAudioCommentActivity
import dagger.Module
import dagger.Provides
import dagger.Subcomponent
import dagger.android.AndroidInjector


@Subcomponent(modules = [(FMAudioCommmentModule::class)])
interface FMAudioCommentComponent : AndroidInjector<FMAudioCommentActivity> {

    @Subcomponent.Builder
    abstract class Builder : AndroidInjector.Builder<FMAudioCommentActivity>() {
        abstract fun newModule(module : FMAudioCommmentModule):Builder

        override fun seedInstance(instance: FMAudioCommentActivity) {
            newModule(FMAudioCommmentModule(instance))
        }
    }
}

@Module
class FMAudioCommmentModule(val mView: FMAudioCommentContract.View) {
    @Provides
    fun getView() = mView
}